package easycloud.ecs.api;

import java.io.File;
import java.util.List;

import easycloud.ecs.api.model.IStorageObject;
import easycloud.ecs.api.model.IStorageObjectListing;
import easycloud.ecs.api.model.IStorageObjectMetadata;
import easycloud.ecs.config.ProviderStatistics;

public interface IProvider {

	/**
	 * @param key
	 * @throws ProviderException
	 */
	boolean delete(String key) throws ProviderException;

	/**
	 * 
	 * @param key
	 * @return
	 * @throws ProviderException
	 */
	IStorageObject getFile(String key) throws ProviderException;

	/**
	 * 
	 * @return
	 */
	String getName();

	/**
	 * 
	 * @return
	 */
	ProviderStatistics getProviderStatistics();

	/**
	 * 
	 */
	void setProviderStatistics(ProviderStatistics stat);
	
	/**
	 * 
	 * @param key
	 * @return
	 * @throws ProviderException
	 */
	IStorageObjectMetadata head(String key) throws ProviderException;

	/**
	 * 
	 * @param path
	 * @param delimiter
	 * @return
	 * @throws ProviderException
	 */
	IStorageObjectListing list(String path, String delimiter)
			throws ProviderException;

	/**
	 * 
	 * @return
	 */
	List<String> listRoots() throws ProviderException;

	/**
	 * 
	 * @param file
	 * @param key
	 * @return
	 * @throws ProviderException
	 */
	IPutResult putFile(File file, String key) throws ProviderException;

	/**
	 * 
	 * @return
	 */
	boolean ready();

}
